package com.tiancheng.trade.order.controller.admin;

import com.tiancheng.trade.commom.core.data.PageInfo;
import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.order.service.QrOrderService;
import com.tiancheng.trade.order.vo.admin.QueryQrPayVO;
import com.tiancheng.trade.order.vo.admin.res.QrPayDetailResVo;
import com.tiancheng.trade.order.vo.admin.res.QueryQrPayResVO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: likailun
 * @Description: 二维码支付-admin
 * @Date: create in 2021/9/1 4:04 下午
 */
@Slf4j
@RestController
@RequestMapping("/admin/qr")
@Validated
public class QrPayAdminController {

    @Resource
    private QrOrderService qrOrderService;


    @GetMapping(value = "/queryList")
    public Result<PageInfo<QueryQrPayResVO>> queryBankList(QueryQrPayVO queryQrPayVO) {
        return Result.success(qrOrderService.queryPage(queryQrPayVO));
    }

    @GetMapping(value = "/queryDetail/{id}")
    public Result<QrPayDetailResVo> queryBankList(@PathVariable("id")Long id) {
        return Result.success(qrOrderService.queryOrderDetailById(id));
    }

    @GetMapping(value = "/queryDetailByOrderId/{orderId}")
    public Result<QrPayDetailResVo> queryDetailByOrderId(@PathVariable("orderId")String orderId) {
        return Result.success(qrOrderService.queryDetailByOrderId(orderId));
    }

}
